<?php

/**
 * 
 * @author nhan
 *
 */
class Model_Product {
	private $id;
	private $name;
	private $viewTimes;
	private $likeTimes;
	private $soldTimes;
	private $linkRefer;
	private $price;
	private $imageFile;
	private $top;
	private $enable;
	private $categoryName;
	private $categoryId;

	public function __construct($data) {
		if (is_array($data)) {
			if (isset($data['ID'])) {
				$this->id = $data['ID'];
			}
			
			if (isset($data['NAME'])) {
				$this->name = $data['NAME'];
			}
			
			if (isset($data['VIEW_TIMES'])) {
				$this->viewTimes = $data['VIEW_TIMES'];
			}
			
			if (isset($data['LIKE_TIMES'])) {
				$this->likeTimes = $data['LIKE_TIMES'];
			}
			
			if (isset($data['SOLD_TIMES'])) {
				$this->soldTimes = $data['SOLD_TIMES'];
			}
			
			if (isset($data['IMAGE_FILE'])) {
				$this->imageFile = $data['IMAGE_FILE'];
			}
			
			if (isset($data['TOP'])) {
				$this->top = $data['TOP'];
			}
			
			if (isset($data['LINK_REFER'])) {
				$this->linkRefer = $data['LINK_REFER'];
			}
			
			if (isset($data['PRICE'])) {
				$this->price = $data['PRICE'];
			}
			
			if (isset($data['ENABLE'])) {
				$this->enable = $data['ENABLE'];
			}
		}
	}

	public function getId() {
		return $this->id;
	}

	public function setId($id) {
		$this->id = $id;
	}

	public function getName() {
		return $this->name;
	}

	public function getViewTimes() {
		return $this->viewTimes;
	}

	public function getLikeTimes() {
		return $this->likeTimes;
	}

	public function getLinkRefer() {
		return $this->linkRefer;
	}

	public function getPrice() {
		return $this->price;
	}

	public function setPrice($price) {
		$this->price = $price;
	}

	public function getImageFile() {
		return $this->imageFile;
	}

	public function setImageFile($imageFile) {
		$this->imageFile = $imageFile;
	}

	public function getEnable() {
		return $this->enable;
	}

	public function setName($x) {
		$this->name = $x;
	}

	public function setViewTimes($viewTimes) {
		$this->viewTimes = $viewTimes;
	}

	public function setLikeTimes($likeTimes) {
		$this->likeTimes = $likeTimes;
	}

	public function getSoldTimes() {
		return $this->soldTimes;
	}

	public function setSoldTimes($soldTimes) {
		$this->soldTimes = $soldTimes;
	}

	public function setLinkRefer($linkRefer) {
		$this->linkRefer = $linkRefer;
	}

	public function setEnable($enable) {
		$this->enable = $enable;
	}

	public function getCategoryName() {
		return $this->categoryName;
	}

	public function getCategoryId() {
		return $this->categoryId;
	}

	public function setCategoryName($categoryName) {
		$this->categoryName = $categoryName;
	}

	public function setCategoryId($categoryId) {
		$this->categoryId = $categoryId;
	}

	public function getTop() {
		return $this->top;
	}

	public function setTop($top) {
		$this->top = $top;
	}
	
	public function tinhTien() {
		return 1000;
	}

}